package com.library.web.controller.app;

import com.library.common.core.controller.BaseController;
import com.library.common.core.domain.AjaxResult;
import com.library.framework.web.service.SysLoginService;
import com.library.framework.web.service.TokenService;
import com.library.service.IAppLoginService;
import com.library.vo.LoginModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author julyWhj
 * @Description 小程序登陆接口$
 * @Date 2022/3/24 1:32 下午
 **/
@Slf4j
@RestController
@RequestMapping("/app/login")
public class AppLoginController extends BaseController {
    @Autowired
    private SysLoginService loginService;

    @PostMapping
    public AjaxResult login(@RequestBody LoginModel loginModel) {
        return AjaxResult.success("登录成功", loginService.appLogin(loginModel.getPhone(), null, loginModel.getCode(), null));
    }

}
